<template>
    <div>
        <!-- 表头 -->
    <el-page-header @back="goBack" :content="content"> </el-page-header>
    <!-- 表单 -->
    {{form}}
    <el-form size="small" ref="form" :model="form" label-width="80px">
      <el-form-item label="名称">
        <el-input v-model="form.name"></el-input>
      </el-form-item>
      <el-form-item label="价值">
        <el-input v-model="form.val"></el-input>
      </el-form-item>
      <el-form-item label="介绍">
        <el-input v-model="form.introduce"></el-input>
      </el-form-item>
      <el-form-item>
        <div style="text-align:right">
          <el-button type="primary" @click="submitHandler">提交</el-button>
        </div>
      </el-form-item>
    </el-form>
  </div>
</template>



<script>
import { post } from '@/utils/request'
export default {
    data(){
        return {
            content:"新增配置信息",
            form:{}
        }
    },
    methods:{
        //提交
        submitHandler(){
            let url="http://localhost:8888/baseConfig"
            post(url,this.form).then(resp=>{
                this.$message({type:"success",message:resp.message})
                this.goBack();

            })
        },
        //返回
        goBack(){
            this.$router.go(-1)
        }
    },
    created(){
        this.form=this.$route.query;
    }
}
</script>

<style lang="sass" scoped>

</style>